import numpy as np
import matplotlib.pyplot as plt

x = np.array([4, 8, 16])
# 创建双Y轴
fig, ax = plt.subplots()
ax.set_xlabel('CPU Cores')

y = np.array([157.11, 164.89, 176.89])  # Mean Throughput(docs/s)
# y = np.array([0, 95.7, 181.57, 308.97])  # Mean Throughput(docs/s)
ax.plot(x, y, 'r-', label='Mean Throughput(docs/s)', color='r')

# 其他设置
ax.legend(loc='upper left')
plt.title('ingestion')

# 保存图像到文件
plt.savefig('ingestion.png', bbox_inches='tight')
# 显示图像
plt.show()
